#include<stdio.h>
typedef struct stu
{
    char name[10];
    int chn;
    int math;
    int eng;
    int sum;
}STU;
int main()
{
    int n;
    scanf("%d", &n);
    STU a[n];
    int max = 0, b = 0;
    for(int i = 0; i < n; i ++)
    {
        scanf("%s %d %d %d", a[i].name, &a[i].chn, &a[i].math, &a[i].eng);
        a[i].sum = a[i].chn + a[i].math + a[i].eng;
        if(a[i].sum > max)
        {
            max = a[i].sum;
            b = i;
        }
    }
    printf("%s %d %d %d\n", a[b].name, a[b].chn, a[b].math, a[b].eng);
    return 0;
}